{% load static %}

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>模板语法</title>
</head>
<body>
<h1>模板语法练习</h1>
<h2>变量的使用：{{department}}</h2>
<h2>取列表的值：{{floor.0}}</h2>
<h2>取列表的值：{{floor.1}}</h2>
<div>
    循环遍历:
    {% for item in floor%}
    <h6>第{{forloop.counter}}个值：{{item}}</h6>
    {% endfor %}
</div>
<div>
    条件语句:
    {% if person.name == '张三' %}
    <h6>这是张三</h6>
    {% elif person.name == '李四' %}
    <h6>这是李四</h6>
    {% else %}
    <h6>没有要找的人</h6>
    {% endif %}
</div>
<img src="{% static 'img/1.jpg' %}" width="800px" height="500px">
</body>
</html>